/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bean;

import dao.BaseDAO;
import dto.BaseDTO;
import java.sql.SQLException;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author Maicon
 */
@ManagedBean
@SessionScoped
public class baseFacede {
        private BaseDAO baseDao = new BaseDAO();
        private BaseDTO baseSelecionado = new BaseDTO();

    public BaseDAO getBaseDao() {
        return baseDao;
    }

    public void setBaseDao(BaseDAO baseDao) {
        this.baseDao = baseDao;
    }

    public BaseDTO getBaseSelecionado() {
        return baseSelecionado;
    }

    public void setBaseSelecionado(BaseDTO baseSelecionado) {
        this.baseSelecionado = baseSelecionado;
    }

    public String incluirBase() throws SQLException, ClassNotFoundException{
        baseDao.incluir(baseSelecionado);
        baseSelecionado = null;
        return "refresh";
    }

}